package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class SubscribeButtonRenderer implements Sequenceable, Serializable {

    @SerializedName("buttonText")
    private ButtonText buttonText;

    @SerializedName("subscribeAccessibility")
    private SubscribeAccessibility subscribeAccessibility;

    @SerializedName("showPreferences")
    private boolean isShowPreferences;

    @SerializedName("type")
    private String type;

    @SerializedName("subscribedButtonText")
    private SubscribedButtonText subscribedButtonText;

    @SerializedName("enabled")
    private boolean isEnabled;

    @SerializedName("unsubscribeButtonText")
    private UnsubscribeButtonText unsubscribeButtonText;

    @SerializedName("signInEndpoint")
    private SignInEndpoint signInEndpoint;

    @SerializedName("subscribed")
    private boolean isSubscribed;

    @SerializedName("unsubscribeAccessibility")
    private UnsubscribeAccessibility unsubscribeAccessibility;

    @SerializedName("trackingParams")
    private String trackingParams;

    @SerializedName("channelId")
    private String channelId;

    @SerializedName("unsubscribedButtonText")
    private UnsubscribedButtonText unsubscribedButtonText;

    @SerializedName("serviceEndpoints")
    private List<ServiceEndpointsItem> serviceEndpoints;



    public static final Sequenceable.Producer<SubscribeButtonRenderer> CREATOR = new Producer<SubscribeButtonRenderer>() {
        @Override
        public SubscribeButtonRenderer createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            SubscribeButtonRenderer subscribeButtonRenderer = new SubscribeButtonRenderer();
            subscribeButtonRenderer.unmarshalling(parcel);
            return subscribeButtonRenderer;
        }
    };
    
    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.buttonText);
        parcel.writeSequenceable(this.subscribeAccessibility);
        parcel.writeBoolean(this.isShowPreferences);
        parcel.writeString(this.type);
        parcel.writeSequenceable(this.subscribedButtonText);
        parcel.writeBoolean(this.isEnabled);
        parcel.writeSequenceable(this.unsubscribeButtonText);
        parcel.writeSequenceable(this.signInEndpoint);
        parcel.writeBoolean(this.isSubscribed);
        parcel.writeSequenceable(this.unsubscribeAccessibility);
        parcel.writeString(this.trackingParams);
        parcel.writeString(this.channelId);
        parcel.writeSequenceable(this.unsubscribedButtonText);
        parcel.writeList(this.serviceEndpoints);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.buttonText);
        parcel.readSequenceable(this.subscribeAccessibility);
        this.isShowPreferences=parcel.readBoolean();
        this.type=parcel.readString();
        parcel.readSequenceable(this.subscribedButtonText);
        this.isEnabled=parcel.readBoolean();
        parcel.readSequenceable(this.unsubscribeButtonText);
        parcel.readSequenceable(this.signInEndpoint);
        this.isSubscribed=parcel.readBoolean();
        parcel.readSequenceable(this.unsubscribeAccessibility);
        this.trackingParams=parcel.readString();
        this.channelId=parcel.readString();
        parcel.readSequenceable(this.unsubscribedButtonText);
        this.serviceEndpoints = parcel.readSequenceableList(ServiceEndpointsItem.class);
        return true;
    }

    @Override
    public String toString() {
        return "SubscribeButtonRenderer{" +
                "buttonText=" + buttonText +
                ", subscribeAccessibility=" + subscribeAccessibility +
                ", isShowPreferences=" + isShowPreferences +
                ", type='" + type + '\'' +
                ", subscribedButtonText=" + subscribedButtonText +
                ", isEnabled=" + isEnabled +
                ", unsubscribeButtonText=" + unsubscribeButtonText +
                ", signInEndpoint=" + signInEndpoint +
                ", isSubscribed=" + isSubscribed +
                ", unsubscribeAccessibility=" + unsubscribeAccessibility +
                ", trackingParams='" + trackingParams + '\'' +
                ", channelId='" + channelId + '\'' +
                ", unsubscribedButtonText=" + unsubscribedButtonText +
                ", serviceEndpoints=" + serviceEndpoints +
                '}';
    }


    public ButtonText getButtonText() {
        return buttonText;
    }

    public void setButtonText(ButtonText buttonText) {
        this.buttonText = buttonText;
    }

    public SubscribeAccessibility getSubscribeAccessibility() {
        return subscribeAccessibility;
    }

    public void setSubscribeAccessibility(SubscribeAccessibility subscribeAccessibility) {
        this.subscribeAccessibility = subscribeAccessibility;
    }

    public boolean isShowPreferences() {
        return isShowPreferences;
    }

    public void setShowPreferences(boolean showPreferences) {
        isShowPreferences = showPreferences;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public SubscribedButtonText getSubscribedButtonText() {
        return subscribedButtonText;
    }

    public void setSubscribedButtonText(SubscribedButtonText subscribedButtonText) {
        this.subscribedButtonText = subscribedButtonText;
    }

    public boolean isEnabled() {
        return isEnabled;
    }

    public void setEnabled(boolean enabled) {
        isEnabled = enabled;
    }

    public UnsubscribeButtonText getUnsubscribeButtonText() {
        return unsubscribeButtonText;
    }

    public void setUnsubscribeButtonText(UnsubscribeButtonText unsubscribeButtonText) {
        this.unsubscribeButtonText = unsubscribeButtonText;
    }

    public SignInEndpoint getSignInEndpoint() {
        return signInEndpoint;
    }

    public void setSignInEndpoint(SignInEndpoint signInEndpoint) {
        this.signInEndpoint = signInEndpoint;
    }

    public boolean isSubscribed() {
        return isSubscribed;
    }

    public void setSubscribed(boolean subscribed) {
        isSubscribed = subscribed;
    }

    public UnsubscribeAccessibility getUnsubscribeAccessibility() {
        return unsubscribeAccessibility;
    }

    public void setUnsubscribeAccessibility(UnsubscribeAccessibility unsubscribeAccessibility) {
        this.unsubscribeAccessibility = unsubscribeAccessibility;
    }

    public String getTrackingParams() {
        return trackingParams;
    }

    public void setTrackingParams(String trackingParams) {
        this.trackingParams = trackingParams;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public UnsubscribedButtonText getUnsubscribedButtonText() {
        return unsubscribedButtonText;
    }

    public void setUnsubscribedButtonText(UnsubscribedButtonText unsubscribedButtonText) {
        this.unsubscribedButtonText = unsubscribedButtonText;
    }

    public List<ServiceEndpointsItem> getServiceEndpoints() {
        return serviceEndpoints;
    }

    public void setServiceEndpoints(List<ServiceEndpointsItem> serviceEndpoints) {
        this.serviceEndpoints = serviceEndpoints;
    }
}
